package com.xu.data.source;

import com.xu.service.IDepartment;
import com.xu.service.IUser;
import com.xu.service.impl.MysqlDepartment;
import com.xu.service.impl.MysqlUser;
import com.xu.service.impl.SqlServerDepartment;
import com.xu.service.impl.SqlServerUser;

/**
 *
 * @author xudenghui
 * @create 2023-08-01 10:09
 **/
public class DataAccess {
    private final static String db = "SqlServer";
//    private final static String db = "Mysql";

    public static IUser createUser(){
        IUser result = null;
        switch (db){
            case "SqlServer":
                result = new SqlServerUser();
                break;
            case "Mysql":
                result = new MysqlUser();
                break;
        }
            return result;
    }


    public static IDepartment createDepartment(){
        IDepartment result = null;
        switch (db){
            case "SqlServer":
                result = new SqlServerDepartment();
                break;
            case "Mysql":
                result = new MysqlDepartment();
                break;
        }
        return result;
    }

}
